HomeAbout MeContact

Creating a cascading dropdown in PowerApps

Published in Power Platform
October 06, 2020
2 min read
Creating a cascading dropdown in PowerApps

Let create first a SharePoint List as our source of choices in our dropdown.

Creating a SharePoint List
Creating a SharePoint List

On the list(CountryList) that we created, let’s add a column and lets named it Continent(Single line of text)

Adding a Column
Adding a Column

Let’s try to populate it with different sets of data.

Populating the list
Populating the list

Now we will create a new list, and let’s call it our MainList

Creating Another list
Creating Another list

The new list we created would be our list where we are going to store our user input. Now we will try to customize its form using PowerApps.

Creating an App under out Lists
Creating an App under out Lists

Let’s call our form “CascadingDropdownForm,” then press Create

Creating the App
Creating the App

Typically, the apps don’t show any data because no item has been added yet.

It currently show no data
It currently show no data

Let go to EditScreen1.

Let's go to the Edit Screen
Let's go to the Edit Screen

Now we will change the “Title” field from a single line of text to “Allowed Values” by clicking on the

Change the Title Field
Change the Title Field

Now we need to unlock it by clicking on the “Title” dropdown and right-click on, and clicking on “unlock.”

Unlocking the Title dropdown
Unlocking the Title dropdown

After that, we will add a connector to our App. This connector will point to our CountryList. To do that, lets click on the “Data”> Connectors > SharePoint

Adding connector
Adding connector

Enter the site URL of your site and hit connect

Connecting the site
Connecting the site

Kindly select our “CountryList” and then press Connect.

Selecting the list we created earlier
Selecting the list we created earlier

This should add a Connection under your “In your App” section.

The Connection should show up
The Connection should show up

Now let’s add the first dropdown to our canvas. We can do that by clicking on Insert > Dropdown. We are going to call it “DropContinent.”

To bind our first dropdown to the appropriate data source, we can do that by selecting the dropdown and then selecting the property named “Items,” then putting “Distinct(CountryList, Continent).” I use the “Distinct” function so that unique values will show up in our DropContinent

We will now bind the dropdown
We will now bind the dropdown

Once it is bound, our first value should already be shown in our form.

A value should show up now
A value should show up now

Now let’s do the same thing to our Title Dropdown. But now we will have a different “Items” value to it. We will use the filter function. Select our second dropdown select the “Items” property then type in “Filter(CountryList, Continent = DropContinent.Selected.Result)”

Now doing the same thing to the Title Dropdown
Now doing the same thing to the Title Dropdown

Note that it will error out, so try clicking on “Edit in the Formula bar.”

Click the "Edit in the Formula bar"
Click the "Edit in the Formula bar"

We should now update the “Update” property with “DataCardValue13.SelectedText.Value”

We need to update the formula
We need to update the formula

Let try it out in the Preview(Press F5). We select “North America” on our first dropdown, and with that, only choice under “North America” shows up.

You should now have cascading dropdowns.
You should now have cascading dropdowns.

Lets us try now to Publish our form and try it out.


Tags

O365M365SharePoint OnlinePowerApps

Share


Previous Article
Connecting to Graphapi securely(Implicit Flow)

Related Posts

Taming the Managed Solution Beast - How to Update Environment Variables
Taming the Managed Solution Beast - How to Update Environment Variables
May 10, 2024
1 min

Quick Links

About MeContact Me

Social Media